<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>取得 GMT 日期的 UNIX 时间戳</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.gmmktime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmmktime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">gmmktime</span> &mdash; <span class="dc-title">取得 GMT 日期的 UNIX 时间戳</span></p>

 </div>
 <div class="refsect1 unknown-unknown-exampleu" id="refsect1-function.gmmktime-unknown-unknown-exampleu">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmmktime</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$hour</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$minute</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$second</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$month</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$day</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$year</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$is_dst</code></span>
  ]]]]]]] ) : <span class="type">int</span></div>

  <p class="para rdfs-comment">
   和 <span class="function"><a href="mktime.html" class="function">mktime()</a></span> 完全一样，只除了返回值是格林威治标准时的时间戳。
  </p>
  <p class="para">
   参数总是表示 GMT 日期，因此 <code class="parameter">is_dst</code>
   对结果没有影响。
  </p>
  <p class="para">
   和 <span class="function"><a href="mktime.html" class="function">mktime()</a></span>
   一样，参数可以从右到左依次空着，空着的参数会被设为相应的当前 GMT 值。
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    自 5.1.0 起，<code class="parameter">is_dst</code> 参数被废弃。因此应该用新的时区处理特性。
   </p>
  </p></blockquote>
  <p class="para">
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <span class="simpara">
     <span class="function"><strong>gmmktime()</strong></span> 内部使用了
     <span class="function"><a href="mktime.html" class="function">mktime()</a></span>，因此只有转换成本地时间也合法的时间才能用在其中。
     so only times valid in derived local time can be used.
    </span>
   </p></blockquote>
   <div class="example" id="example-2723">
    <p><strong>Example #1 <span class="function"><strong>gmmktime()</strong></span> 在 Windows 中的边界</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />gmmktime</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1970</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;在&nbsp;GMT&nbsp;和西方合法，在东方不合法<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
  <p class="para">
   参见 <span class="function"><a href="mktime.html" class="function">mktime()</a></span>，<span class="function"><a href="date.html" class="function">date()</a></span>
   和 <span class="function"><a href="time.html" class="function">time()</a></span>。
  </p>
 </div>

</div></div></div></body></html>